package com.smart.manager.pop.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.smart.common.entities.ajax.AjaxResult;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.common.entities.core.Page;
import com.smart.manager.pop.entities.body.RBasicDiamondLog;
import com.smart.manager.pop.entities.models.PopBasicDiamondLogs;
import com.smart.manager.pop.repository.PopBasicDiamondLogRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 礼包资料
 * @author leo
 * @date 2023/09/07
 */
@Api(tags =  "礼包礼包")
@RestController
@RequestMapping(SmartConstant.MANAGER_API_PREFIX + "pop/basic/diamondLogs")
@RequiredArgsConstructor
public class BasicDiamondLogApi {

    private final PopBasicDiamondLogRepository repository;
    
    @GetMapping(value = "pageList")
    @ApiOperation(value = "查询兑换记录")
    @SaCheckPermission("pop:diamond:logs:pageList")
    public AjaxResult<Page<PopBasicDiamondLogs>> pageList(@Validated RBasicDiamondLog.SearchBody body) {
        Page<PopBasicDiamondLogs> result = repository.pageList(body);
        return AjaxResult.data(result);
    }
}
